package org.example.type;

import lombok.Data;

import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;

@Data
public final class TypeHandlerRegistry {

    private final Map<JdbcType, TypeHandler<?>> jdbcTypeHandlerMap = new EnumMap<>(JdbcType.class);
    private final Map<Class<?>, TypeHandler<?>> allTypeHandlersMap = new HashMap<>();


    public TypeHandlerRegistry(){
        register(Long.class, new LongTypeHandler());
    }

    private void register(Class<Long> jdbcType, LongTypeHandler handler) {
        allTypeHandlersMap.put(jdbcType, handler);
    }
}